<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pe="http://primefaces.org/ui/extensions">


    <ui:define name="content">


        <h:panelGroup rendered="true" >
            <h:form>

                <p:panel id="panelPrint" header="Investigation Month End Summary"/>
                    <f:facet name="header" >
                        <h:outputLabel value="Investigation Month End Summary"/>

                        <p:commandButton ajax="false"  value="Refresh"  styleClass="noPrintButton" style="float: right;" />

                        <p:commandButton ajax="false" value="Print" styleClass="noPrintButton" style="float:right;">
                            <p:printer target="panelPrint" />
                        </p:commandButton>

                        <p:commandButton value="Excel" ajax="false" style="float: right;">
                            <pe:exporter type="xlsx" fileName="Investigation Month End Summary" facetBackground="#AAFFBB"   datasetPadding="4"
                                         target="tbl"/>
                        </p:commandButton>

                        <p:panelGrid columns="4" style="min-width: 100%;">
                            <h:outputLabel value="From Date"/>
                            <p:calendar id="frmDate" value="#{investigationMonthSummeryController.fromDate}" pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>

                            <h:outputLabel value="To Date"/>
                            <p:calendar id="toDate" value="#{investigationMonthSummeryController.toDate}" pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>
                        </p:panelGrid>

                    </f:facet>
                    <br/><br/>
                    <p:dataTable id="tbl" value="#{investigationMonthSummeryController.items}" var="c" >
                        
                        <f:facet name="header">
                            <h:outputLabel value="Investigation Month End Summary"/>
                            
                        </f:facet>
                        
                        <p:column headerText="Test Name" >
                            <f:facet name="header">
                                <h:outputLabel value="Test Name"/>
                            </f:facet>
                            <h:outputLabel value="#{c.investigation.name}"/>
                        </p:column>

                        <p:column headerText="Count">
                            <f:facet name="header">
                                <h:outputLabel value="Count"/>
                            </f:facet>
                            <h:outputLabel value="#{c.count}"/>
                        </p:column>

                        <p:column headerText="Total" style="text-align: right;" >
                            <f:facet name="header">
                                <h:outputLabel value="Total"/>
                            </f:facet>
                            <h:outputLabel value="#{c.total}"><f:convertNumber pattern="#,##0.00" /></h:outputLabel>
                        </p:column>

                    </p:dataTable>




                </p:panel>        
            </h:form>
        </h:panelGroup>
    </ui:define>

</ui:composition>
